+++ /dev/null
-import download
-import hashlib
-import os
-import re
-import shutil
-import sys
-
-datere = re.compile('^\d{4}-\d{2}-\d{2}')
-cksumre = re.compile('^ ([^ ]+) ([^$]+)$')
-
-current = None
-snaps = {}
-d = os.path.dirname(os.path.dirname(__file__))
-with open(d + '/snapshots.txt') as f:
- for line in iter(f):
- line = line.rstrip()
- m = datere.match(line)
- if m:
- current = m.group()
- snaps[current] = {}
- continue
-
- m = cksumre.match(line)
- if m:
- snaps[current][m.group(1)] = m.group(2)
- continue
-
- # This script currently doesn't look at older snapshots, so there is
- # no need to look past the first section.
- break
-
-date = current
-triple = sys.argv[1]
-
-ts = triple.split('-')
-arch = ts[0]
-
-if (arch == 'i586') or (arch == 'i386'):
- arch = 'i686'
-
-if len(ts) == 2:
- vendor = 'unknown'
- target_os = ts[1]
-else:
- vendor = ts[1]
- target_os = ts[2]
-
-# NB: The platform format differs from the triple format, to support
-# bootstrapping multiple triples from the same snapshot.
-plat_arch = arch if (arch != 'i686') else 'i386'
-plat_os = target_os
-if (target_os == 'windows'):
- plat_os = 'winnt'
-elif (target_os == 'darwin'):
- plat_os = 'macos'
-platform = "%s-%s" % (plat_os, plat_arch)
-if platform not in snaps[date]:
- raise Exception("no snapshot for the triple '%s'" % triple)
-
-# Reconstitute triple with any applicable changes. For historical reasons
-# this differs from the snapshots.txt platform name.
-if target_os == 'linux':
- target_os = 'linux-gnu'
-elif target_os == 'darwin':
- vendor = 'apple'
-elif target_os == 'windows':
- vendor = 'pc'
- target_os = 'windows-gnu'
-triple = "%s-%s-%s" % (arch, vendor, target_os)
-hash = snaps[date][platform]
-
-tarball = 'cargo-nightly-' + triple + '.tar.gz'
-url = 'https://static.rust-lang.org/cargo-dist/%s/%s' % \
- (date.strip(), tarball)
-dl_path = "target/dl/" + tarball
-dst = "target/snapshot"
-
-if not os.path.isdir('target/dl'):
- os.makedirs('target/dl')
-
-if os.path.isdir(dst):
- shutil.rmtree(dst)
-
-exists = False
-if os.path.exists(dl_path):
- h = hashlib.sha1(open(dl_path, 'rb').read()).hexdigest()
- if h == hash:
- print("file already present %s (%s)" % (dl_path, hash,))
- exists = True
-
-if not exists:
- download.get(url, dl_path)
- h = hashlib.sha1(open(dl_path, 'rb').read()).hexdigest()
- if h != hash:
- raise Exception("failed to verify the checksum of the snapshot")
-
-download.unpack(dl_path, dst, strip=2)
+++ /dev/null
-import contextlib
-import os
-import subprocess
-import sys
-import tarfile
-
-
-def get(url, path, quiet=False):
- # see http://serverfault.com/questions/301128/how-to-download
- if sys.platform == 'win32':
- run(["PowerShell.exe", "/nologo", "-Command",
- "(New-Object System.Net.WebClient).DownloadFile('" + url +
- "', '" + path + "')"], quiet=quiet)
- else:
- run(["curl", "-o", path, url], quiet=quiet)
-
-
-def unpack(tarball, dst, quiet=False, strip=0):
- if quiet:
- print("extracting " + tarball)
- with contextlib.closing(tarfile.open(tarball)) as tar:
- for p in tar.getmembers():
- if p.isdir():
- continue
- path = []
- p2 = p.name
- while p2 != "":
- a, b = os.path.split(p2)
- path.insert(0, b)
- p2 = a
- if len(path) <= strip:
- continue
- fp = os.path.join(dst, *path[strip:])
- if not quiet:
- print("extracting " + p.name)
- contents = tar.extractfile(p)
- if not os.path.exists(os.path.dirname(fp)):
- os.makedirs(os.path.dirname(fp))
- open(fp, 'wb').write(contents.read())
- os.chmod(fp, p.mode)
-
-
-def run(args, quiet=False):
- if not quiet:
- print("running: " + ' '.join(args))
- sys.stdout.flush()
- # Use Popen here instead of call() as it apparently allows powershell on
- # Windows to not lock up waiting for input presumably.
- ret = subprocess.Popen(args,
- stdin=subprocess.PIPE,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- out, err = ret.communicate()
- code = ret.wait()
- if code != 0:
- print("stdout: \n\n" + out)
- print("stderr: \n\n" + err)
- raise Exception("failed to fetch url")
+++ /dev/null
-#!/usr/bin/env python
-
-import download
-import os
-import shutil
-import sys
-
-if os.environ.get('BITS') == '32':
- host_bits = 'i686'
- extra_bits = 'x86_64'
-else:
- host_bits = 'x86_64'
- extra_bits = 'i686'
-
-
-# Figure out our target triple
-if sys.platform == 'linux' or sys.platform == 'linux2':
- host = host_bits + '-unknown-linux-gnu'
- targets = [
- 'aarch64-unknown-linux-gnu',
- 'arm-unknown-linux-gnueabi',
- 'arm-unknown-linux-gnueabihf',
- 'armv7-unknown-linux-gnueabihf',
- 'i686-unknown-freebsd',
- 'i686-unknown-linux-gnu',
- 'mips-unknown-linux-gnu',
- 'mipsel-unknown-linux-gnu',
- 'mips64-unknown-linux-gnuabi64',
- 'mips64el-unknown-linux-gnuabi64',
- 's390x-unknown-linux-gnu',
- 'powerpc-unknown-linux-gnu',
- 'powerpc64-unknown-linux-gnu',
- 'powerpc64le-unknown-linux-gnu',
- 'x86_64-unknown-freebsd',
- 'x86_64-unknown-linux-gnu',
- 'x86_64-unknown-linux-musl',
- 'x86_64-unknown-netbsd',
- ]
-elif sys.platform == 'darwin':
- host = host_bits + '-apple-darwin'
- targets = ['i686-apple-darwin', 'x86_64-apple-darwin']
-elif sys.platform == 'win32':
- if os.environ.get('MSVC') == '1':
- host = host_bits + '-pc-windows-msvc'
- targets = [
- 'i686-pc-windows-msvc',
- 'x86_64-pc-windows-msvc',
- ]
- else:
- host = host_bits + '-pc-windows-gnu'
- targets = [host]
-else:
- exit_msg = "There is no official Cargo snapshot for {} platform, sorry."
- sys.exit(exit_msg.format(sys.platform))
-
-rust_date = open('src/rustversion.txt').read().strip()
-url = 'https://static.rust-lang.org/dist/' + rust_date
-cargo_url = 'https://static.rust-lang.org/cargo-dist/2016-03-21'
-
-
-def install_via_tarballs():
- if os.path.isdir("rustc-install"):
- shutil.rmtree("rustc-install")
-
- # Download cargo
- host_fname = 'cargo-nightly-' + host + '.tar.gz'
- download.get(cargo_url + '/' + host_fname, host_fname)
- download.unpack(host_fname, "rustc-install", quiet=True, strip=2)
- os.remove(host_fname)
-
- # Download the compiler
- host_fname = 'rustc-nightly-' + host + '.tar.gz'
- download.get(url + '/' + host_fname, host_fname)
- download.unpack(host_fname, "rustc-install", quiet=True, strip=2)
- os.remove(host_fname)
-
- # Download all target libraries needed
- for target in targets:
- fetch_std(target)
-
- if os.path.isdir("rustc"):
- shutil.rmtree("rustc")
- os.rename("rustc-install", "rustc")
-
-
-def fetch_std(target):
- fname = 'rust-std-nightly-' + target + '.tar.gz'
- print("adding target libs for " + target)
- download.get(url + '/' + fname, fname)
- download.unpack(fname, "rustc-install", quiet=True, strip=2)
- os.remove(fname)
-
-install_via_tarballs()
+++ /dev/null
-2016-03-21
- linux-i386 ac401c16ff53e0c51b88707579b4f95d7d4c4763
- linux-x86_64 84266cf626ca4fcdc290bca8f1a74e6ad9e8b3d9
- macos-i386 3550c653db2b8a41fdd7057339c923353081e7b0
- macos-x86_64 0372d52f6d06e3e18c8ffa6f016638b6d082770e
- winnt-i386 4bacbd3e0219f424740ce35e74a005b007a552aa
- winnt-x86_64 8fc67036c4c76fbfa1d8532d9b9ac923f9060001
-
-2016-01-31
- linux-i386 7e2f9c82e1af5aa43ef3ee2692b985a5f2398f0a
- linux-x86_64 4c03a3fd2474133c7ad6d8bb5f6af9915ca5292a
- macos-i386 4d84d31449a5926f9e7ceb344540d6e5ea530b88
- macos-x86_64 f8baef5b0b3e6f9825be1f1709594695ac0f0abc
- winnt-i386 8702f7e3c49ef4a4eb9ffed2f1ca94ac288e48ff
- winnt-x86_64 a531f9a7399cdcc6aa14a0f070df4ff3851772fa
-
-2015-04-02
- dragonfly-x86_64 7d330a67ad82701ee65a08a47a51c3b0b26697bc
- freebsd-x86_64 2e0ade0901864ea67200f990cb289343b08959e7
- bitrig-x86_64 1b39aba2b9e1a7c9b5ac890b864eb1cb8a18e4d0
- openbsd-x86_64 1e2a02520f9e8e300a3d7ef91c1ab03e6baeebe6
- linux-i386 ba6c162680d5509d89ba2363d7cae2047f40c034
- linux-x86_64 94f715c9a52809a639f2ce6f8b1d5215a0c272b5
- macos-i386 cf333f16f89bfd50e8ce461c6f81ca30d33f7f73
- macos-x86_64 1f7008a6ec860e2bc7580e71bdf320ac518ddeb8
- winnt-i386 8c0088ae9e47133b976f7ad155c50ca9abb2906c
- winnt-x86_64 01ae9ea568211a20f048e7b00d902d6fe72d1627
-
-2015-03-26
- linux-i386 d8b59fb0a0e8222b1753370f1d7c91dcb9697b37
- linux-x86_64 e2f8388d6bccad3b3f09bbbe4ea1bc9671224f4c
- macos-i386 3baad9c920c4a68bfd8c10ba3afb80013559adf5
- macos-x86_64 394afa61b945717bca18412c3c93a428db7d6d5d
- winnt-i386 4bc98dabc039c34c040942f0eadd99ddb37f06dc
- winnt-x86_64 54d948ed95b86b9c63861246cf7cfd7161a48a20
-
-2015-03-17
- linux-i386 96a64fa9b4b6cc0cddaa90ecde4e08254c9025d5
- linux-x86_64 354bb5b11b1f19e270ebc0553db1ddc560999bdb
- macos-i386 d1b69ef765bc450a3758b8abdb0909df7893058b
- macos-x86_64 a2328a82e073c230cd88dcfac96bdc784a999200
- winnt-i386 fb6e346d59bda47ed87e36800e8bfe210cf01297
- winnt-x86_64 4ef3d1ce315df8b27bd842fb66b8e2b03ce99a08
-
-2015-02-26
- linux-i386 2a28b604d09b4a76a54a05d91f7f158692427b3a
- linux-x86_64 7367f4aca86d38e209ef7236b00175df036c03e2
- macos-i386 e5cabb0a4a2b4e47f7b1ae9b802e2b5d0b14eac5
- macos-x86_64 3026c60ddd46d2bcf1cb178fc801095dbfba5286
- winnt-i386 2008eed3965ed9a989a38c22b9c55c02ae9db1f1
- winnt-x86_64 98a48d7a6dbffcd099ea2574a68f04883624d9a1
-
-2015-01-24
- linux-i386 96213038f850569f1c4fa6a0d146c6155c0d566b
- linux-x86_64 4d87486493c2881edced7b1d2f8beaac32aaa5b5
- macos-i386 17b9fc782e86bffe170abb83a01e0cb7c90a0daa
- macos-x86_64 18887bdbd3e6d2a127aa34216fa06e9877b0fbc6
- winnt-i386 10b9b5fa3e9241ef0b6c3b77b0c072a45b585905
- winnt-x86_64 ba71627e46964535b64da56bd0679e5f86fae957
-
-2014-12-30
- linux-i386 ab8bba0918d3d2ddbd7fd21f147e223dbf04cece
- linux-x86_64 0efe0f7bcbcbeb5494affcc8a2207db448a08c45
- macos-i386 e5097005b0a27c186b8edee24982fd4c3ebba81e
- macos-x86_64 6c0bb776e5645fb93b67341b111c715f39b25511
- winnt-i386 2088c5256445b5bb2da57a71f6a9671e5a280477
- winnt-x86_64 950e25bcedc5ba9d96891523c9967f81d5f6c74d
-
-2014-12-21
- linux-i386 4dea04e278192c5409f43794a98f20a8f59df2d9
- linux-x86_64 3e48c573d3c4d26591feb7bfe988174720f08374
- macos-i386 dc3d498c0567af4a0820e91756dcfff8fde0efac
- macos-x86_64 f301bd8c3c93a5c88698c69190e464af1525ac96
- winnt-i386 5b6bc87e302d1ff6ac9b0576292eb7cbff2c3b83
- winnt-x86_64 a8bb8d3a7ed3fc8caf4a33d6b9d2e43544877409
-
-2014-12-20
- linux-i386 1cccab5a6ac8e73472bf78cdce019cd1a60d4638
- linux-x86_64 53c176fcda0a40fb77b901303c443de3dce3e58d
- macos-i386 bbc23c78ca4307efa6250552a097e6b2ccfe2cc3
- macos-x86_64 4f97a30408c99858ad2b7a7f6edfe3d5b8f0ff3f
- winnt-i386 5d77cd604b011100398023e8dc3d98c173247874
- winnt-x86_64 1290dcc2a51e99027803d641c08299abe1265158
-
-2014-12-18
- linux-i386 30eec547395093ab9c6a0587a3210666b9272815
- linux-x86_64 20d13252996838680f4356a7addd75403bb11aec
- macos-i386 c179a345cb1fbb08f8173133701635ef3c0e03be
- macos-x86_64 4f2a877828a2d8ca7d66906529bde01b26d8cef7
- winnt-i386 fa20b54e06badc5fb092981d442e4e831dd9c5f8
- winnt-x86_64 196cae1120f5070e7dd4796d19ed45b9dd01aba2
-
-2014-12-08
- linux-i386 853d29bc167748f8a481d5d43fb20ab99e3e16ee
- linux-x86_64 57c79c64459145321baa8fc45d51c588d18125ad
- macos-i386 43b483c9a389243ce58ba5356c4f71a626dc5658
- macos-x86_64 3777768da6a820f49d789c3477b493b24de59a61
- winnt-i386 b831d1d673db189496f94d3596351d9545687947
- winnt-x86_64 846b677e6fec99690b00595b934fdb30b834c815
-
-2014-11-22
- linux-i386 3204c8a38721199f69d2971db887d1dc71a63825
- linux-x86_64 39ca0d02eac184bc764ff9c1f645ca361715c5c2
- macos-i386 ebc1836424c4b3ba49f9adef271c50d2a8e134c0
- macos-x86_64 a2045e95984b65eab4a704152566f8ab9a3be518
- winnt-i386 5e0831b14d2e6ee91ef195dfbc4d9699499d5e99
- winnt-x86_64 d5fa1b58207346061898459955fa7f0b33d77474
-
-2014-11-11
- linux-i386 5cbf3346309d303cb954c363097fc4abedf50610
- linux-x86_64 8c1594e227eca6f23ba02daa5f3cd6150ac88907
- macos-i386 f338835a58cc5357ed092a23ba0ddbf2624dfacd
- macos-x86_64 b2d03a6a9422c42b7f5ba008c8851ddc89ae693c
- winnt-i386 50b851d94181375f0c7a00aacb7d8d63960eddc7
- winnt-x86_64 aa12a1cb80a665f53066a15774360d686b3e5968
-
-2014-11-07
- linux-i386 f65ae2b9d94477fec79e444ea489ff98a456e033
- linux-x86_64 1a7f663d8f4e2109240a20d8e63c958e0557d883
- macos-i386 9d82a00bd396c99cc27693864da2364d0394e843
- macos-x86_64 1dc297d8e149384a76dfb7efc7869b82fe663b92
- winnt-i386 d9f87d83c6cbabd7a4794498e4c3a4e94df0740a
- winnt-x86_64 74284401082e1b5aff14a72e2152ed5cb55812cf
-
-2014-10-28
- linux-i386 15fb3dd24140911ba707d8b4b1dd6826732a3ad6
- linux-x86_64 a924d82f5dc987efda6303d3e2c1aeb8ade34faa
- macos-i386 bfaddd7eacd1dec4749ab4918fad47f50fa64467
- macos-x86_64 43a91c484f665be2ec0959e2e884ab93cce06a6b
- winnt-i386 299de1d99341fed17dc2726e5564dd0ab0ca1dfa
- winnt-x86_64 1948ae424458c498f904ea97efb00350a7d8598f
-
-2014-10-16
- linux-i386 61417861716cd41d8f372be36bb0572e4f29dec8
- linux-x86_64 59be4ff9f547f1ba47ad133ab74151a48bc2659b
- macos-i386 cb5267d2e7df8406c26bb0337b1c2e80b125e2cb
- macos-x86_64 9283adb4dfd1b60c7bfe38ef755f9187fe7d5580
- winnt-i386 88deb2950fa2b73358bc15763e6373ade6325f53
- winnt-x86_64 0143d4b0e4b20e84dbb27a4440b4b55d369f4456
-
-2014-09-19
- linux-i386 c92895421e6fa170dbd713e74334b8c3cf22b817
- linux-x86_64 66ee4126f9e4820cd82e78181931f8ea365904de
- macos-i386 e2364b1f1ece338b9fc4c308c472fc2413bff04e
- macos-x86_64 09f92f06ab4f048acf71d83dc0426ff1509779a9
- winnt-i386 0c9b75d5b9ca58a7e39290fbe9c54d91db65c42c
- winnt-x86_64 180c547aa79ba3069852450a6e833b577c7d4c3d
-
-2014-09-11
- linux-i386 f18823de75413ab72df91deb9b3b341c02005b2e
- linux-x86_64 58d9789472dd955be94903cafd406ce394915297
- macos-i386 07da45add611e7ecea8f9115ee551df1ff354f51
- macos-x86_64 0b82c9c58865fe8298273ee5fafc937db1b80528
- winnt-i386 4782a7014dd53213535f19b1f2a09f640cf00490
-
-2014-09-03
- linux-i386 d357756680a60cd00464fa991b71170dcddb2b30
- linux-x86_64 35fd121fda3509cc020d42223017be03a1c19b87
- macos-i386 40aad83e9d97f5a344179f4573807f3ac04775f9
- macos-x86_64 5e64f637019f499585ab100e5072b8eeeba191ed
- winnt-i386 fc25a2f6f9ce3a6f11348ffe17e1115ca81fc4db
-
-2014-08-19
- linux-i386 8d20fc36b8b7339fcd1ae6c118f1becd001c2b08
- linux-x86_64 46e05521f0dceeb831462caa8a54ca1caf21c078
- macos-i386 fd65cf0e9c6fa137db666da289aa4359dbc56ca1
- macos-x86_64 59ba26a9c92af40c08eed443dcfca518718a2ba1
- winnt-i386 cb0c4fa54abebb86d1a4bb28c2b1d084234c3b35
-
-2014-08-16
- linux-i386 30ea09ef95aa230ff415319be699c950603a8fb4
- linux-x86_64 95badae811c711ae5d03f837a38f6ae12c8e473a
- macos-i386 5b7afe93a4a79416bab0778e7e03a786cf2e9252
- macos-x86_64 e4141beae6e3dae44393d148492ec9ac1ac1ae5c
- winnt-i386 580cb0e92ddb1e2f935386183543c3d0152f13b9
-
-2014-08-12
- linux-i386 af5e80dba2d845e30039302e57bd516c96b347de
- linux-x86_64 42a7786073802d6b47dbb6d2bb071a322964b28e
- macos-i386 244595a91534ce3097877d96241ae21d150e670d
- macos-x86_64 8c56578bd4610adcc1b608aa841c13f6f9b60d45
- winnt-i386 4708fba1f267c1c32460c7d8b4cd2ed8c32a1ecb
-
-2014-08-08
- linux-i386 44207002e96c4f1309af70673966ee1e67938f5e
- linux-x86_64 5dc5e5aa575814af2d4e40e9dcdca2c55b594bd1
- macos-i386 5d1924057a0d56d033f32680f4b393cdd9c6805a
- macos-x86_64 65462ea1e48cb4b4c57ff7e947cd2cc26a8f2723
- winnt-i386 a481b15d35ab2e1d1dcd2f181a2566e097604ffc
-
-2014-08-06
- linux-i386 eb7c2a87b30db077f6f1c4ea724ebd0e5cc07d1c
- linux-x86_64 1672657adb9012df2912bbb2f43466f1c6817e55
- macos-i386 1224207bbfa9f46796940512ac8a7a9ab9f5665b
- macos-x86_64 da4afea32d7336a0a91b8fe160d38896385d4ae2
- winnt-i386 2b6b2efe9ec77d3d456c943bb2e54f2281309ef1
-
-2014-08-04
- linux-i386 49032ce8c5c2b94d73e298dcbdb09e0b2fbe573c
- linux-x86_64 98c83ecc7cac3765d62f5e8b19bdc506e01f3cab
- macos-i386 c450260a2edace970089b35fed644eb607b509ba
- macos-x86_64 04763ba59b70240d16bdb57845e3511b3b243522
- winnt-i386 15a70b068beb3b85760279496cf62b7406e5e2b2
-
-2014-07-30
- linux-i386 4d4e78426060b891cf729d5e3cca86d5aebdd31d
- linux-x86_64 2a39bb838bc1c740d41a2ee8054a2c32f1efbec8
- macos-i386 16d1581dad71b1cf551646bc2dfdc920f4dda16c
- macos-x86_64 05d836f2195e55f050e68e8bb209405a67fbefcb
- winnt-i386 ade95f921ba73848d2ae67d1b8cd7c364e881e86
-
-2014-07-29
- mac 53f8bc39132e987d25e022698c3234fee0916ecf
- linux b7dbdc89126577fda2eef7d63c5f7fc1d8d28f99
- win 9551454e2ce649d146ad8d856cee3672ab0def02
-
-2014-07-26
- mac 9a78815c7fcdb1cdabc93eb120f80444f209d968
- linux b38e7c45292d2cc6a1932fa9a1f349f9b92c0c1d
- win 4e955f8b80684ea6c9ca2dd6e2c235ce2d9cf21f